<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		
		<style type="text/css">
			body{
				padding-top: 50px;
			}
		</style>
	</head>
	<script>
		setCookie("login","true", 10);
		
		alert( getCookie("login") );
		
		
		function setCookie(key,value, n){
			var d = new Date();
			d.setDate( d.getDate()+n );
			document.cookie = key+"="+value+";expires="+d;
		}
		
		
		function getCookie(key){
			var cookiestr = document.cookie;
			var list = cookiestr.split("; ");
			for(var i in list){
				var kv = list[i].split("=");
				if(key == kv[0]) {
					return kv[1];
				}
			}
			return null;
		}
		
		
	</script>
	<body>
		
	</body>
</html>
